# 嘉宾接口对象层
import requests

from utils.SendMethod import SendMethod


class Guest:
    def __init__(self):
        self.url = 'http://127.0.0.1:8000'

    # 添加嘉宾
    def add_guest(self, payload):
        method = 'post'
        url = self.url + '/api/add_guest/'
        return SendMethod().send_method(method, url, data=payload)

    # 查询嘉宾
    def get_guest(self, eid=None, phone=None):
        method = 'get'
        url = self.url + '/api/get_guest_list/'
        payload = {
            "eid": eid,
            "phone": phone
        }
        return SendMethod().send_method(method, url, params=payload)

    # 嘉宾签到
    def sign_guest(self, eid=None, phone=None):
        method = 'post'
        url = self.url + '/api/user_sign/'
        payload = {
            "eid": eid,
            "phone": phone
        }
        return SendMethod().send_method(method, url, params=payload)
